package com.me.shop.order.adminaction;



import java.util.List;

import com.me.shop.order.bean.Order;
import com.me.shop.order.bean.OrderItem;
import com.me.shop.order.service.OrderService;
import com.me.shop.utils.PageBean;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class AdminOrderAction extends ActionSupport implements ModelDriven<Order> {
	private Order order = new Order();
	public Order getModel() {
		return order;
	}
	
	private OrderService orderService;
	public void setOrderService(OrderService orderService) {
		this.orderService = orderService;
	}
	
	private Integer page;
	public void setPage(Integer page) {
		this.page = page;
	}
	
	public String findAll()	{
		PageBean<Order> pageBean = orderService.findByPage(page);
		ActionContext.getContext().getValueStack().set("pageBean", pageBean);
		return "findAll";
	}
	
	public String findOrderItem() {
		List<OrderItem> list = orderService.findOrderItem(order.getOid()); 
		ActionContext.getContext().getValueStack().set("list", list);
		return "findOrderItem";
	}
	
}














